<template>
  <div>开单</div>
  <ul>
    <li v-for="item in list" :key="item._id">{{ item.title }}</li>
  </ul>
</template>

<script lang="ts" setup>
import axios from "axios";
// import request from "@/utils/request";
import { ratedApi, detailApi } from "@/api/pos";
import { onMounted, ref } from "vue";

interface ItemType {
  _id: string;
  title: string;
  [propname: string]: any;
}

const list = ref<ItemType[]>([]);

onMounted(() => {
  // ratedApi({ x: 10, y: 20 }).then((res) => {
  //   list.value = res.result;
  // });

  // const res = await ratedApi({ x: 10, y: 20 });
  // list.value = res.result;

  // const res2 = await detailApi({ id: "1228788" });
  // console.log(res2);

  Promise.all([ratedApi({ x: 10, y: 20 }), detailApi({ id: "1228788" })]).then(
    (res: any) => {
      list.value = res[0] && res[0].result;
      console.log(res[1]);
    }
  );
});
</script>
